<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 13.08.14
 * Time: 15:18
 */

namespace Messenger\Users;

use Messenger\Groups;
use Messenger\BaseAction;

class ListAction extends BaseAction
{
	protected static $isPublic = true;
	
	/**
	 * Указываем необходимые неявные параметры
	 * @return multitype:string
	 */
	static function pullParams() {
		return ['identity'];
	}
	
    /**
     * Выводит список пользователей доступных для общения в текущей вкладке
     */
    protected function run()
    {
        $listStatus = $this->request->listStatus;
        $myProfileId = $this->request->_identity;
        $groupsModel = new Groups();
        $companionProfileId = $this->request->companionProfileId;

        $this->response->myProfileId = $myProfileId;
        $this->response->listStatus = $listStatus;
        $this->response->companionProfileId = $companionProfileId;
        $this->response->groups = $groupsModel->getListWithProfileStatus($myProfileId, $listStatus);
    }
}